package YAPserver.mods;

import YAPenvironment.YAPconstant.ModState;
import YAPserver.gameObjects.Mod;
import YAPserver.logic.GameModifier;
import YAPserver.logic.Player;
/**
 * A local ModBehaviour.
 * When this modBehaviour's modify method is called the specified player's movement is set topsy-turvy. That means when the player presses left
 * he goes right and when he presses right he goes left. If he catches another one of these mods the current movement setting is thus set topsy-turvy.
 * The demodify method toggles topsy-turvy and is called onece the mod's timer has reached 0.
 * @author Daniel
 *
 */
public class ModTopsyTurvy extends AbstractStandardMod{

	@Override
	public void modify(Mod mod, GameModifier gameMod, Player player) {
		super.modify(mod, gameMod, player);
		gameMod.addModActive(mod);
		player.toggleTopsyTurvy();
		mod.setTimerOn(true);
	}

	@Override
	public void deModify(Mod mod, GameModifier gameMod, Player player) {
		gameMod.removeModActive(mod);
		player.toggleTopsyTurvy();
	}

	@Override
	public ModState getType() {
		return ModState.player;
	}

}
